const express = require('express')
const router = express.Router()
const userinfoHandler = require('../router_handler/userinfo')
const handleValidationErrors = require('../middleware/handleValidationErrors')

const { updateUserInfoSchema, updatePwdSchema } = require('../schema/userinfo')

router.get('/userinfo', userinfoHandler.getUserInfo)

router.post('/userinfo', updateUserInfoSchema, handleValidationErrors, userinfoHandler.updateUserInfo)

router.post('/updatepwd', updatePwdSchema, handleValidationErrors, userinfoHandler.updatePwd)

module.exports = router